1. Field of the Invention
The present invention relates to packet switching and routing protocols, specifically to Transmission Control Protocol (TCP) management techniques.
2. Description of the Related Art
Generally, in data communication over TCP/IP, a client initiates a TCP connection towards the server, the server and client go through a three-way handshake through a TCP proxy to establish a connection between the client and the server. The TCP proxy terminates the client connection and initiates a separate connection towards the server. TCP proxy behaves as a server towards the client and as a client towards the server. TCP proxy provides TCP services that are transparent to the end hosts (e.g., load balancing, web caching, SSL termination or the like)
An application running on the client requests TCP proxy to forward a request for data on the connection to the server. The client's request can span over multiple TCP segments. The TCP proxy receives the request (e.g., data) from the client application, processes the request (e.g., encrypts, decrypts or the like), initiates a connection with the server, manages the connection and data buffers and forwards the request (e.g., data) to the server. An application running on the server services the data request and responses to the client's request (e.g., by requesting the TCP proxy to forward a response, requested data or the like) on the connection to the client. The server response can span over multiple TCP segments.
The TCP proxy generally supports multiple simultaneous TCP connections (e.g., on the order of tens/hundreds of thousands). TCP proxy manages data transfer for each instance of applications associated with each connection. When the TCP proxy receives data from a server into receive buffer for that server connection, the TCP proxy transmits data into a transmit buffer for requesting application on the client's connection. The TCP proxy waits for the client application to ‘pull’ the data from the transmit buffers. The TCP proxy waits until the transmit buffer has more space.
To support multiple connections, the TCP proxy must optimally manage data buffers and control memory to provide enough buffer space to each connection. Typically, each TCP process advertises a data window size to its peers in a network. The window size reflects the amount of buffer space allocated to each connection. The window size can be fixed based on the available buffer space and the number of ‘simultaneously active’ connections configured in the server. Because the TCP proxy does not know how the client applications work, the TCP proxy must wait for the client applications to ‘pull’ data from the transmit buffers. The waiting for client application to ‘pull’ data reduces the efficiency of the data communication. A method and an apparatus are needed to effectively and optimally manage the data buffers and control memory.